//
//  BuyViewController.m
//  网易彩票
//
//  Created by zhoup on 16/5/29.
//  Copyright © 2016年 zhoup. All rights reserved.
//

#import "BuyViewController.h"

@interface BuyViewController ()

@property (weak, nonatomic) IBOutlet UIButton *titleButton;


@property(nonatomic,strong)  UIView *menu;

@end

@implementation BuyViewController

-(UIView *)menu
{
    if (!_menu) {
        UIView *menu = [[UIView alloc]init];
        [menu setBackgroundColor:[UIColor blueColor]];
        
        menu.bounds = CGRectMake(0, 0, 200, 0);
        menu.center = self.view.center;
        menu.y = CGRectGetMaxY(self.navigationController.navigationBar.frame);
        [self.view addSubview:menu];
        
        _menu = menu;
    }
    
    return _menu;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.menu.height = 0;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)titleButtonClicked:(UIButton *)sender
{
   
    
    
    
    [UIView animateWithDuration:0.25 animations:^{
        if (CGAffineTransformIsIdentity(self.titleButton.imageView.transform)) {
            self.menu.height = 200;
            self.titleButton.imageView.transform = CGAffineTransformMakeRotation(M_PI);
        }
        else
        {
            self.menu.height = 0;
            self.titleButton.imageView.transform = CGAffineTransformIdentity;
        }
    
    } completion:^(BOOL finished) {
        
    }];
    
}
@end
